/*!
 * \file cics_gateway.h
 *
 * \brief GATEWAY调用
 *
 * All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.
 *
 * \version 1.0
 * \author songbb
 * \date 2015/10/07
 *
 */

#ifndef __CICS_GATEWAY_H_
#define __CICS_GATEWAY_H_

#define CICS_GATEWAY_RC2STR(x) ((x==0)?NULL: \
                               ((x==61441)?"ERROR_CONNECTION_FAILED": \
                               ((x==61442)?"ERROR_UNKNOWN_REQUEST_TYPE": \
                               ((x==61443)?"ERROR_REPLY_MISMATCH": \
                               ((x==61444)?"ERROR_GATEWAY_CLOSED": \
                               ((x==61445)?"ERROR_WORK_WAS_REFUSED": \
                               ((x==61446)?"ERROR_GATEWAY_EXCEPTION": \
                               ((x==61447)?"ERROR_NOT_AUTHORIZED": \
                               ((x==61448)?"ERROR_NOT_SUPPORTED": \
                               ((x==61449)?"ERROR_XA_SUPPORT_NOT_ENABLED": \
                               ((x==61450)?"ERROR_GATEWAY_BACK_LEVEL": \
                               ((x==61451)?"ERROR_INVALID_REQUEST_TYPE":"ERROR_UNKNOWN_GATEWAY_RC"))))))))))))  //!< RC返回值转字符串

/*!
 * 解析ECI请求与响应
 *
 * \param p_st_conn         (ct信息)
 * \param p_st_sess         (CICS的session信息)
 * \param p_st_cics_packet  (CICS数据包)
 * \param p_st_hash_report  (数据上报用)
 *
 * \return 0  失败\n
 *         1  成功
 *
 */
int cics_gateway(Conntrack *p_st_conn
                , L7session_cics *p_st_sess
                , L7_cics_packet *p_st_cics_packet
                , Frhash_header *p_st_hash_report);

#endif
